import request from '@/utils/request'

// 查询车位锁管理列表
export function listParkinglock(query) {
  return request({
    url: '/business/parkinglock/list',
    method: 'get',
    params: query
  })
}

// 查询车位锁管理详细
export function getParkinglock(macid) {
  return request({
    url: '/business/parkinglock/' + macid,
    method: 'get'
  })
}

// 新增车位锁管理
export function addParkinglock(data) {
  return request({
    url: '/business/parkinglock',
    method: 'post',
    data: data
  })
}

// 修改车位锁管理
export function updateParkinglock(data) {
  return request({
    url: '/business/parkinglock',
    method: 'put',
    data: data
  })
}

// 删除车位锁管理
export function delParkinglock(macid) {
  return request({
    url: '/business/parkinglock/' + macid,
    method: 'delete'
  })
}

// 降锁升锁
export function operateParkinglock(macid,type) {
  return request({
    url: `/business/parkinglock/operate/${macid}/${type}`,
    method: 'get'
  })
}

// 降锁升锁
export function beepCmd(macid,type,sec) {
  return request({
    url: `/business/parkinglock/beep/cmd/${macid}/${type}/${sec} `,
    method: 'get'
  })
}

// 读取地锁状态
export function getParkStatus(macId) {
  return request({
    url: `/business/parkinglock/status/get/${macId}`,
    method: 'get'
  })
}

// 读取地锁功能参数
export function getParkParam(macId) {
  return request({
    url: `/business/parkinglock/param/get/${macId}`,
    method: 'get'
  })
}

// 读取地锁功能参数
export function setParkParam(macid,option,value) {
  return request({
    url: `/business/parkinglock/param/set/${macid}/${option}/${value}`,
    method: 'post'
  })
}
